<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js第一课</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/style1.css">
</head>
<body>
	<input type="button" name="登录" value="登录" onclick="demo(true)">
	
	<div id="box">
		<div id="logIn_Box">
			<div id="header">
				<span class="fl">
					<img src="img/baidu/logo.png" alt="logo">
				</span>
				<span class="fl">
					登录百度帐号
				</span>
				<span class="fr" onclick="demo(false)">
					<img src="img/baidu/cancel.png" alt="cancel">
				</span>
			</div>
		</div>
	</div>
</body>

	<script type="text/javascript">
		function demo(bool){
			
			var box = document.getElementById('box');

			if (bool) {
				box.style.display = 'block';
			}else{
				box.style.display = 'none';	
			}
		}



	</script>


</html>